package cn.bocweb.spinning.view.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bigkoo.convenientbanner.ConvenientBanner;
import com.bigkoo.convenientbanner.holder.CBViewHolderCreator;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.bocweb.spinning.R;
import cn.bocweb.spinning.util.DeviceUtil;

public class Test111Activity extends AppCompatActivity {


    @Bind(R.id.convenientBanner)
    ConvenientBanner convenientBanner;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test111);
        ButterKnife.bind(this);

    }

    @Override
    protected void onStart() {
        super.onStart();
        List<ImageView> imageViews = new ArrayList<>();

        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

        ImageView img1 = new ImageView(this);
        ImageView img2 = new ImageView(this);
        ImageView img3 = new ImageView(this);

        img1.setImageResource(R.mipmap.btn_bbs);
        img2.setImageResource(R.mipmap.exam_b);
        img3.setImageResource(R.mipmap.guide_bg);

        img1.setLayoutParams(layoutParams);
        img2.setLayoutParams(layoutParams);
        img3.setLayoutParams(layoutParams);

        imageViews.add(img1);
        imageViews.add(img2);
        imageViews.add(img3);

        convenientBanner.setPages(new CBViewHolderCreator() {
            @Override
            public Object createHolder() {
                return null;
            }
        }, imageViews);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        DeviceUtil.Log("activity onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();

    }
}
